#ifndef __GTK_UTIL_H__
#define __GTK_UTIL_H__

#include <gtk/gtk.h>
#define lo(x)  (x & 0xFF)
#define hi(x)  ((x >> 8) & 0xFF)

#define save_free(d) do { \
  if ((d)) \
    { \
    g_free((d)); \
    (d) = NULL; \
    } \
  } while(0)


void UpdateGTK(void);
void WidgetSetColor(GtkWidget *w, GdkColor *text_color, GdkColor *bg_color);
void SetSensitive(GtkWidget **widget_list[], gboolean sensitive);
void SetSensitiveList(GtkWidget **widget_list[], unsigned char *sen_list);;
gchar *GetDefaultFont(GtkWidget *widget, int monospace);
void TextLoadFromFile(GtkWidget *widget, const char *filename);
char *CreateFileName(char *dir, char *file_name);
int SplitFileName(char *full_file_name, char **dir_name, char **file_name);
GtkWidget *TextPageNewFromFile(const char *filename);

#endif
